package com.framework.common.util.threadlocal;

/**
 * @author 龘鵺
 * @version 1.0
 * @className com.framework.common.util.threadlocal
 * @description 操作缓存
 * @datetime 2024-06-23 23:34:13
 */
public class ThreadLocalUtil {
    /**
     * 租户编号
     */
    private static final ThreadLocal<Long> tenantIdThreadLocal = new ThreadLocal<Long>();
    /**
     * 角色代码
     */
    private static final ThreadLocal<String> roleCodeThreadLocal = new ThreadLocal<String>();

    public static Long getTenantId() {
        return tenantIdThreadLocal.get();
    }

    public static void setTenantId(Long tenantId) {
        tenantIdThreadLocal.set(tenantId);
    }

    public static String getRoleCode() {
        return roleCodeThreadLocal.get();
    }

    public static void setRoleCode(String roleCode) {
        roleCodeThreadLocal.set(roleCode);
    }

}
